export function getUri(url : string, req : { [name : string] : any }) {
	// const searchParams = new URLSearchParams()
	// Object.entries(req).forEach(([key, value]) => {
	// 	if (Array.isArray(value)) {
	// 		value.length && searchParams.set(key, value.join(","))
	// 	} else if (typeof value === "object") {
	// 		for (let key of value) {
	// 			searchParams.set(key, value[key])
	// 		}
	// 	} else if (value !== undefined) {
	// 		searchParams.set(key, value)
	// 	}
	// })
	const arr = []
	Object.entries(req).forEach(([key,value])=>{
		if(Array.isArray(value)){
			value.length && arr.push(`${key}=${value.join(",")}`)
		}else if(typeof value === 'object'){
			for (let k of value) {
				arr.push(`${k}=${value[k]}`)
			}
		}else if(value){
			arr.push(`${key}=${value}`)
		}
	})

	return `${url}?${arr.join("&")}`
}